package com.ganyu.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    EMAIL_EXIST(502,"邮箱已存在"),
    NICKNAME_EXIST(503, "昵称已存在"),
    REQUIRE_USERNAME(504, "请输入用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    REQUIRE_PASSWORD(506, "请输入密码"),
    ERROR_SYSTEM(507,"系统异常"),
    CONTENT_ISNULL(508,"评论不能为空"),
    FILE_TYPE_ERROR(509,"请上传png或jpg类型"),
    FILE_IS_NULL(510,"未上传头像"),
    REQUIRE_NICKNAME(511, "请输入昵称"),
    REQUIRE_EMAIL(512, "请输入邮箱"),
    NOTUPDATE(513,"修改菜单'写博文'失败，上级菜单不能选择自己"),
    NODELETE(514,"存在子菜单不允许删除"),
    CAN_NOT_WATCH(518,"没有权限"),
    PASSWORD_ERROR(519,"密码错误"),
    USERNAME_ERROR(520,"用户名不存在"),
    PHONENUMBER_EXIST(517,"电话已存在");

    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}